package com.netease.spring.ch1;

import org.springframework.beans.factory.BeanFactory;
import org.springframework.beans.factory.xml.XmlBeanFactory;
import org.springframework.core.io.ClassPathResource;
import org.springframework.core.io.FileSystemResource;

public class Main {

    /**
     * @param args
     */
    public static void main(String[] args) {
        testHello();
    }

    public static void testHello() {
        ClassPathResource resource = new ClassPathResource("ch1_hello.xml");
        FileSystemResource resource2 = new FileSystemResource("ch1_hello.xml");
        BeanFactory beanFactory = new XmlBeanFactory(resource);
        GreetingService greetingService = (GreetingService) beanFactory
                .getBean("greetingService");
        greetingService.sayGreeting();
    }
}
